<?php
namespace app\qian\controller;

use think\Controller;
use app\qian\model\BmModel as BmModels;
use think\Db;

class Bm extends Controller
{
    private $cModel;   //当前控制器关联模型

    public function _initialize()
    {
        parent::_initialize();
        $this->cModel = new BmModels;   //别名：避免与控制名冲突
    }

    public function index()
    {
        if($this->request->isPost()){
            ECHO 1 ;
        }else{
            $dataList=Db::table('dy_ng')->select();
            $this->assign('dataList', $dataList);
            $nam = Db::table('dy_movie')->join('dy_movie_type a','a.id=dy_movie.fid')->
            field('dy_movie_type.id,type,dy_movie.id,title,pic,contect,dy_movie_type.status,dy_movie.status,dy_movie.create_time,dy_movie.update_time,dy_movie_type.create_time,dy_movie_type.update_time ')->paginate('3', false, page_param());
            $this->assign('nam', $nam);
            return view('dianying');
        }
    }


}